//
//  Created by Rene Dohan on 12/5/11.
//


#import "MainController.h"
#import "Application.h"


@implementation MainController {

}

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)viewDidUnload {
    [super viewDidUnload];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    if ([Application getInstance].isLogged) {
        if ([[Application getInstance] isMerchant]) {
            [self performSegueWithIdentifier:@"ToMerchantSegue" sender:self];
        } else {
            [self performSegueWithIdentifier:@"ToAffiliateSegue" sender:self];
        }
    } else [self performSegueWithIdentifier:@"ToSettingsSegue" sender:self];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}


- (void)onLoginDone {
    [self dismissModalViewControllerAnimated:true];
}

@end